<%@ page import="java.util.List" %>
<%@ page import="com.web.test.bean.EmpInformation" %>
<%@ page import="com.web.test.dao.EmpInfoDao" %>
<%@ page import="com.web.test.utils.SQLUtils" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: St01
  Date: 2017-9-21
  Time: 17:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="f" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
    <title>9-21练习</title>
</head>
<style>
    td {
        width: 100px;
    }
</style>
<%
    List<EmpInformation> empInfoList = new EmpInfoDao().find(SQLUtils.empInfoAll);
    session.setAttribute("empInfoList", empInfoList);
%>
<body>
<c:if test="${f:length(empInfoList) > 0}">
    <table border="1px" cellspacing="0px" cellpadding="20px">
        <thead>
        <tr>
            <th>员工编号</th>
            <th>入职时间</th>
            <th>工资</th>
        </tr>
        </thead>
        <c:forEach var="i" items="${empInfoList}" begin="${0}" end="${empInfoList.size()}" step="1">
            <tr>
                <td>${i.empNo}</td>
                <td>
                    <fmt:parseDate value="${i.entryTime}" type="date" var="newDate"></fmt:parseDate>
                    <fmt:formatDate value="${newDate}" pattern="yyyy:MM:dd" timeStyle="long"></fmt:formatDate>
                </td>
                <td><fmt:formatNumber type="currency" value="${i.sal}" pattern="$.00"></fmt:formatNumber></td>
            </tr>
        </c:forEach>
    </table>

</c:if>

</body>
</html>
